package com.games.ecoship.client;

import com.games.ecoship.EcoShipConstants;

public class Ship implements EcoShipConstants {
	
	private static int shipCount = 0;
	
	public static final int HORIZONTAL    = 0;
	public static final int VERTICAL      = 1;
	public static final int MIN_SHIP_SIZE = 2;
	
	private int shipNum;
	private int size;
	private int direction = HORIZONTAL;
	
	public Ship(int size) {
		this.shipNum = ++shipCount;
		this.size = size;
		if (size > NUM_COLS || size < 1)
			System.err.println(new Exception("Ship #" + shipNum + " has an invalid size."));
	}
	
	public void setOrientation(int direction) {
		this.direction = direction;
	}
	
	public int getOrientation() {
		return direction;
	}
	
	public int getSize() {
		return size;
	}
	
	public int getShipNum() {
		return shipNum;
	}

	public static int getShipCount() {
		return shipCount;
	}
}
